home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 2004 #11 / Amiga Plus CD - 2004 - No. 11.iso / AmiSoft / Misc / emu / ASpEmu_NOROM.lha / ASpV084 / Rexx / LoadSCR.asprx next >
Text File  |  2000-10-20  |  1KB  |  42 lines

  1. /* $VER: LoadSCR 1.1 */
  2.  
  3. /* Load a .SCR file into the ASp display RAM */
  4. /* Warning: Original data overwritten.       */
  5. /*          Running program may trash image  */
  6.  
  7. OPTIONS RESULTS
  8.  
  9. GETVERSION            /* ask which ASp version is running */
  10. IF result<760 THEN DO        /* minimum of V0.76 to use this script */
  11.     ADDRESS COMMAND 'requestchoice >nil: TITLE "ASp ARexx Error" BODY "Requires ASp V0.76 or newer!" GADGETS "OK"'
  12.     EXIT
  13. END
  14.  
  15.  
  16. /* A messy File Requester using the DOS C:RequestFile command.. */
  17.  
  18. ADDRESS COMMAND "RequestFile >T:ASpRequest PATTERN=#?.SCR"
  19. OPEN(TMPFILE,'T:ASpRequest',R)
  20. filename=STRIP(READLN(TMPFILE),B,'"')
  21. CLOSE(TMPFILE)
  22.  
  23.  
  24. IF OPEN(SCRFILE,filename,READ) THEN DO        /* open the file */
  25.     IF SEEK(SCRFILE,0,END)==6912 THEN DO    /* check file length */
  26.         SEEK(SCRFILE,0,BEGIN)
  27.         filedata=READCH(SCRFILE,6912)    /* read it */
  28.         GETPAGE                /* which screen? */
  29.         p=RESULT
  30.         IF BITTST(D2C(p),3) THEN DO    /* bit 3= scr buf */
  31.             SETPAGE 7        /* force shadow page in */
  32.             WRITERAM 49152 filedata    /* write pic */
  33.             SETPAGE p        /* put paging back */
  34.         END
  35.         ELSE DO
  36.             WRITERAM 16384 filedata /*write pic in normal display */
  37.         END
  38.     END
  39.     CLOSE(SCRFILE)                /* tidy up behind us.. */
  40. END
  41.  
  42.